#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int mod=1000000007;
ll qmi(int a, int b, int p)
{
    ll res = 1;
    while (b)
    {
        if (b & 1) res = res * a % p;
        a = a * (ll)a % p;
        b >>= 1;
    }
    return res;
}
int main()
{
    ll n;
    cin>>n;
    ll ans=0;
    for(int i=1;i<=n/i;i++)
    {
        ans=(ans+n/i*i)%mod;
        ll l=sqrt(n)+1;
        ll r=n/i;
        ans=ans+(l+r)*(r-l+1)/2;   
    }
    cout<<ans;
    return 0;
}

